﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DBSourceToolsLib
{
    public class DateHelper
    {
        public string GetCurrentDateFormatted()
        {
            return String.Format("{0}{1}{2}",
                                DateTime.Now.Year, PadZeros(DateTime.Now.Month), PadZeros(DateTime.Now.Day));

        }
        public string GetCurrentTimeFormatted()
        {
            return String.Format("{0}{1}",
                    PadZeros(DateTime.Now.Hour), PadZeros(DateTime.Now.Minute));

        }
        private string PadZeros(int intVal)
        {
            return String.Format(intVal < 10 ? "0{0}" : "{0}", intVal);
        }

    }
}
